<!DOCTYPE html>
<html lang="zh-CN">
  <head>
	  <%layout("/WEB-INF/view/common/inc/admin_head.html",{title:'添加', styles:'bootstrap,font-awesome,animate,style,dtvalidate,layui,chosen'}){%>
	  <style type="text/css">
		  body{padding-top:10px;}
		  .radio{
			  vertical-align:middle;
			  margin-top:5px;
		  }
	  </style>
	  <%}%>
  </head>
  <body>

	<!-- START 内容部分 -->
	<div class="container">
		<form class="form-horizontal" id="info-form" method="post" autocomplete="off">
			<input type="hidden" id="id" name="id" value="${performanceDetail.id}">
			<div class="form-group">
				<label class="control-label col-sm-2">数据来源:</label>
				<div class="col-sm-8">
					<select id="performanceSource" name="performanceSource" xm-select="performanceSource"  xm-select-search>
						<option value=""></option>
						<%for(var dict in powerGroup){%>
						<option value="${dict.groupName}" <%if(dict.groupName == performanceDetail.performanceSource){print("selected");}%> >${dict.groupName}</option>
						<%}%>
					</select>
					<input type="hidden" name="source" id="source" value="${performanceDetail.performanceSource}">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label text-right">绩效目标:</label>
				<div class="col-sm-8">
					<input type="text" id="performanceTask" disabled name="performanceTask" value="${performanceDetail.performanceTask}" class="form-control" />
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-sm-2">权重:</label>

				<div class="col-sm-2">
					<div class="input-group m-b">
						<input type="text" id="performanceWeight"  name="performanceWeight" value="${performanceDetail.performanceWeight}"  onkeyup="value=value.replace(/[^\d\.]/g,'')" class="form-control"  /> <span class="input-group-addon">%</span>
					</div>
				</div>
			</div>

			<div class="form-group">
				<label class="control-label col-sm-2">考核办法:</label>
				<div class="col-sm-8">
					<textarea id="performanceCheck" name="performanceCheck"  class="form-control" rows="3">${performanceDetail.performanceCheck}</textarea>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<button type="button" class="save-btn btn btn-primary">
						<i class="fa fa-save"></i> 保存
					</button>
				</div>
			</div>
		</form>
	</div>
	<!-- END 内容部分 -->
  </div>
	<!-- START 公共脚本 -->
    <%layout("/WEB-INF/view/common/inc/admin_js.html",{modules:'jquery,bootstrap,dtvalidate,dtvalidate-lang-zh_cn,laydate,layer,chosen,chosen-demo'}){}%>
	<!-- END 公共脚本 -->

	<script>
	var cvalidator;
	$(function(){
		//初始化验证器
		cvalidator = $.fn.dlshouwen.validator.init($('#info-form'));

		formSelects.render('performanceSource');
		var names=$("#source").val();
		if(names.length>0) {
			var list = names.split(",");
			var ids = [];
			for (var i = 0; i < list.length; i++) {
				ids.push(list[i]);
			}
			formSelects.value('performanceSource', ids);
		}
		//提交表单
		$('.save-btn').on('click',function(){
			//数据提交
			$.post('/sea/human/performanceDetail/usave.do',$('#info-form').serialize(),function(data){
				if( data.ok ){
					parent.layer.msg(data.msg,{icon:1,time:1500,shade: [0.8, '#393D49']}, function(){
						parent.$cultureTable.bootstrapTable('refresh');
						parent.layer.close(parent.layer.getFrameIndex(window.name)); //关闭弹窗
					});
				}else{
					parent.layer.msg(data.msg,{icon: 0,time:1500,shade: [0.8, '#393D49']});
				}
			});
		});



    });

	$('.return-btn').on('click',function(){
		parent.layer.close(parent.layer.getFrameIndex(window.name)); //关闭弹窗
	});
    </script>
  </body>
</html>